#ifndef RWLock_h
#define RWLock_h
#include <iostream>
#include <queue>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
enum rw_t {writer, reader};

class RWLock {
    public:
        RWLock();
        void rlock();
        void wlock();
        void runlock();
        void wunlock();

    private:
        pthread_rwlock_t rwlock;
        int leyendo;
        bool escribiendo;
        bool quieroEscribir;
        queue<int> cola;
        int id;
};

#endif
